<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>租房意向</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../../../taofang/plugins/bootstrap-3.3.7-dist/css/bootstrap.css">
    <link rel="stylesheet" href="../../../taofang/css/TenantCentre.css">
    <link rel="stylesheet" href="../../../taofang/css/home.css">
</head>
<body>
<script src="../../../taofang/plugins/jquery-3.4.1.js"></script>
<script src="../../../taofang/plugins/bootstrap-3.3.7-dist/js/bootstrap.js"></script>

<%@include file="top.jsp"%>


<div class="col-md-9 zy5">
    <p class="zy51">租房意向</p>
    <p class="zy52"></p>
    <div class="zf1" style="font-size: 30px;color: black;opacity: 0.5">
        意向选择及修改,勾选完毕后请点击<span style="color: blue;font-weight:bolder">"确定"</span>保存<br>
    </div>
    <br>
    <div class="zf2">
        房屋配套设施要求(多选):
    </div>
    <div class="zf22">
        <label class="checkbox-inline">
            <input type="checkbox" id="box1" value="op1" <c:if test="${intention.fridge}">checked</c:if>> 冰箱
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="box2" value="op2" <c:if test="${intention.television}">checked</c:if>> 电视
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="box3" value="op3" <c:if test="${intention.airCondition}">checked</c:if>> 空调
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="box4" value="op4" <c:if test="${intention.geyser}">checked</c:if>> 热水器
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="box5" value="op5" <c:if test="${intention.washingMachine}">checked</c:if>> 洗衣机
        </label>
    </div>
    <div class="zf22">
        <label class="checkbox-inline">
            <input type="checkbox" id="box6" value="op6" <c:if test="${intention.broadband}">checked</c:if>> 宽带
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="box7" value="op7" <c:if test="${intention.sofa}">checked</c:if>> 沙发
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="box8" value="op8" <c:if test="${intention.balcony}">checked</c:if>> 阳台
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="box9" value="op9" <c:if test="${intention.gasStove}">checked</c:if>> 燃气灶
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="box10" value="op10" <c:if test="${intention.rangeHood}">checked</c:if>> 油烟机
        </label>
    </div>
    <div class="zf22">
        <label class="checkbox-inline">
            <input type="checkbox" id="box11" value="op11" <c:if test="${intention.wardrobe}">checked</c:if>> 衣柜
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="box12" value="op12" <c:if test="${intention.heat}">checked</c:if>> 暖气
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="box13" value="op13" <c:if test="${intention.bed}">checked</c:if>> 床&nbsp;&nbsp;&nbsp;&nbsp;
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="box14" value="op14" <c:if test="${intention.intelligentLock}">checked</c:if>> 智能门锁
        </label>
    </div><hr>
    <div class="zf2">
        周边环境(多选):
    </div>
    <div class="zf22">
        <label class="checkbox-inline">
            <input type="checkbox" id="boxa" value="opa" <c:if test="${intention.greenery}">checked</c:if>> 绿化多
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="boxb" value="opb" <c:if test="${intention.schoolNearbyHouse}">checked</c:if>> 学区房
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="boxc" value="opc" <c:if test="${intention.cookingable}">checked</c:if>> 可做饭
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="boxd" value="opd" <c:if test="${intention.bathroom}">checked</c:if>> 独立卫生间
        </label>
    </div>
    <div class="zf22">
        <label class="checkbox-inline">
            <input type="checkbox" id="boxe" value="ope" <c:if test="${intention.trafficConvenient}">checked</c:if>> 交通便利
        </label>
        <label class="checkbox-inline">
            <input type="checkbox" id="boxf" value="opf" <c:if test="${intention.shoppingConvenient}">checked</c:if>> 购物方便
        </label>
    </div>
    <hr>
    <div style="margin-top: 5%;margin-left: 30%">
    <button type="button" onclick="changeintention()" class="btn btn-info">确定</button>&nbsp;&nbsp;&nbsp;
    <button type="button" class="btn btn-info" onclick="intentionFind()">根据意向查看房源</button>
    </div>

</div>
<%@include file="bottom.jsp"%>

<script>
        function changeintention() {
            let box1 = document.getElementById("box1").checked;
            let box2 = document.getElementById("box2").checked;
            let box3 = document.getElementById("box3").checked;
            let box4 = document.getElementById("box4").checked;
            let box5 = document.getElementById("box5").checked;
            let box6 = document.getElementById("box6").checked;
            let box7 = document.getElementById("box7").checked;
            let box8 = document.getElementById("box8").checked;
            let box9 = document.getElementById("box9").checked;
            let box10 = document.getElementById("box10").checked;
            let box11 = document.getElementById("box11").checked;
            let box12 = document.getElementById("box12").checked;
            let box13 = document.getElementById("box13").checked;
            let box14 = document.getElementById("box14").checked;
            let boxa = document.getElementById("boxa").checked;
            let boxb = document.getElementById("boxb").checked;
            let boxc = document.getElementById("boxc").checked;
            let boxd = document.getElementById("boxd").checked;
            let boxe = document.getElementById("boxe").checked;
            let boxf = document.getElementById("boxf").checked;
            let tenantId =$("#tenantId").val();

            if(confirm("是否保存")) {
                alert("保存成功")
                window.location = "/taofang/intention/updateIntention.action?fridge=" + box1 + "&television=" + box2 + "&airCondition=" + box3 + "&geyser=" + box4 +
                    "&washingMachine=" + box5 + "&broadband=" + box6 + "&sofa=" + box7 + "&balcony=" + box8 + "&gasStove=" + box9 +
                    "&rangeHood=" + box10 + "&wardrobe=" + box11 + "&heat=" + box12 +
                    "&bed=" + box13 + "&intelligentLock=" + box14 + "&greenery=" + boxa + "&schoolNearbyHouse=" + boxb + "&cookingable=" + boxc + "&bathroom=" + boxd +
                    "&trafficConvenient=" + boxe + "&shoppingConvenient=" + boxf + "&tenantId=" + tenantId;
            }else{
                window.location = "/taofang/intention/TenantIntention.action?tenantId="+tenantId;
            }

        }




        function intentionFind() {
            let box1 = document.getElementById("box1").checked;
            let box2 = document.getElementById("box2").checked;
            let box3 = document.getElementById("box3").checked;
            let box4 = document.getElementById("box4").checked;
            let box5 = document.getElementById("box5").checked;
            let box6 = document.getElementById("box6").checked;
            let box7 = document.getElementById("box7").checked;
            let box8 = document.getElementById("box8").checked;
            let box9 = document.getElementById("box9").checked;
            let box10 = document.getElementById("box10").checked;
            let box11 = document.getElementById("box11").checked;
            let box12 = document.getElementById("box12").checked;
            let box13 = document.getElementById("box13").checked;
            let box14 = document.getElementById("box14").checked;
            let boxa = document.getElementById("boxa").checked;
            let boxb = document.getElementById("boxb").checked;
            let boxc = document.getElementById("boxc").checked;
            let boxd = document.getElementById("boxd").checked;
            let boxe = document.getElementById("boxe").checked;
            let boxf = document.getElementById("boxf").checked;

            window.location="/taofang/House/zhengjie.action?fridge=" + box1 + "&television=" + box2 + "&airCondition=" + box3 + "&geyser=" + box4 +
                "&washingMachine=" + box5 + "&broadband=" + box6 + "&sofa=" + box7 + "&balcony=" + box8 + "&gasStove=" + box9 +
                "&rangeHood=" + box10 + "&wardrobe=" + box11 + "&heat=" + box12 +
                "&bed=" + box13 + "&intelligentLock=" + box14 + "&greenery=" + boxa + "&schoolNearbyHouse=" + boxb + "&cookingable=" + boxc + "&bathroom=" + boxd +
                "&trafficConvenient=" + boxe + "&shoppingConvenient=" + boxf;


        }
</script>

</body>
</html>